package jmine.tec.scheduling.services.incluir;

import jmine.tec.services.runner.BaseServiceBuilder;

/**
 * @author lundberg
 */
public class ScheduledTaskServiceBuilder extends BaseServiceBuilder {

    public ScheduledTaskServiceBuilder() {
        super(ScheduledTaskService.class);
    }

    public static ScheduledTaskServiceBuilder aTask() {
        ScheduledTaskServiceBuilder builder = new ScheduledTaskServiceBuilder();
        builder.mnemonic("task");
        builder.cron("0 0/5 14 * * ?");
        builder.action("noOperationAction");
        builder.condition("alwaysExecuteCondition");
        builder.active(true);
        builder.description("description");
        return builder;
    }

    public ScheduledTaskServiceBuilder id(Long value) {
        this.with(ScheduledTaskService.DATABASE_ID, value);
        return this;
    }

    public ScheduledTaskServiceBuilder mnemonic(String value) {
        this.with(ScheduledTaskService.MNEMONIC, value);
        return this;
    }

    public ScheduledTaskServiceBuilder description(String value) {
        this.with(ScheduledTaskService.DESCRIPTION, value);
        return this;
    }

    public ScheduledTaskServiceBuilder active(Boolean value) {
        this.with(ScheduledTaskService.ACTIVE, value);
        return this;
    }

    public ScheduledTaskServiceBuilder cron(String value) {
        this.with(ScheduledTaskService.CRON, value);
        return this;
    }

    public ScheduledTaskServiceBuilder condition(String value) {
        this.with(ScheduledTaskService.CONDITION, value);
        return this;
    }

    public ScheduledTaskServiceBuilder action(String value) {
        this.with(ScheduledTaskService.ACTION, value);
        return this;
    }
}
